//
//  AttentionViewController.m
//  XiangMuB
//
//  Created by 向修根 on 16/8/12.
//  Copyright © 2016年 lanou3g. All rights reserved.
//

#import "AttentionViewController.h"


#import "QuestionViewController.h"
#import "TopicViewController.h"
#import "FoucesViewController.h"
#import "InvitationViewController.h"



@interface AttentionViewController ()


@end

@implementation AttentionViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
   

//    UIButton *button = [UIButton buttonWithType:(UIButtonTypeCustom)];
//    button.frame = CGRectMake(100, 100, 100,100);
//    button.backgroundColor = [UIColor cyanColor];
//    [button addTarget:self action:@selector(button) forControlEvents:(UIControlEventTouchUpInside)];
    
//    [self segment];
//    [self.view addSubview:button];
    
    CGSize screenSize = [UIScreen mainScreen].bounds.size;
    [self setTabBarFrame:CGRectMake(0, 64, screenSize.width, 44)
        contentViewFrame:CGRectMake(0, 64, screenSize.width, screenSize.height - 64 - 50)];
    self.tabBar.itemTitleColor = [UIColor lightGrayColor];
    self.tabBar.itemTitleSelectedColor = [UIColor redColor];
    self.tabBar.itemTitleFont = [UIFont systemFontOfSize:17];
    self.tabBar.itemTitleSelectedFont = [UIFont systemFontOfSize:22];
    self.tabBar.leftAndRightSpacing = 20;
    
    self.tabBar.itemFontChangeFollowContentScroll = YES;
    self.tabBar.itemSelectedBgScrollFollowContent = YES;
    self.tabBar.itemSelectedBgColor = [UIColor redColor];
    
    [self.tabBar setItemSelectedBgInsets:UIEdgeInsetsMake(40, 15, 0, 15) tapSwitchAnimated:NO];
    [self.tabBar setScrollEnabledAndItemFitTextWidthWithSpacing:40];
    
    [self setContentScrollEnabledAndTapSwitchAnimated:NO];
    
    [self initViewControllers];
    

    
    

}

- (void)initViewControllers {
    TopicViewController *controller1 = [[TopicViewController alloc] init];
    controller1.yp_tabItemTitle = @"话题";
    
 
     QuestionViewController *controller2 = [[QuestionViewController alloc] init];
    controller2.yp_tabItemTitle = @"问答";
    
    InvitationViewController *invita = [InvitationViewController new];
    invita.yp_tabItemTitle = @"帖子";
    InvitationViewController *invitation = [InvitationViewController new];
    invitation.yp_tabItemTitle = @"帖子";
    
    FoucesViewController *controller3 = [[FoucesViewController alloc] init];
     controller3.yp_tabItemTitle = @"关注";
    
    
    
  self.viewControllers = [NSMutableArray arrayWithObjects:controller1, controller2,invita,controller3 , nil];
  self.viewControllers = [NSMutableArray arrayWithObjects:controller1, controller2, invitation,controller3 , nil];
}




//- (void)button{
//    TopicViewController *topic = [TopicViewController new];
//    [self showViewController:topic sender:nil];
//}





- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
